<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>添加项目</title>
</head>
<body>
<div style="width:100%">

    <div class="items clearfix">

        <h2 style="" class="tal">正在操作：添加项目</h2>

        <div class="items2">

            <div>
                <form id="project_test" onsubmit="return false;">
                    <table>
                        <tbody>
                            <tr>
                                <td class="tar" width="150">项目名称：</td>
                                <td width='*'>
                                    <input type="text" id="projectName" name="projectName" style="width: 150px;" value="">
                                    <font color="red">*（项目名称必须填写）</font>
                                </td>
                            </tr>
                            <tr>
                                <td class="tar">项目别名：</td>
                                <td>
                                    <input type="text" id="projectAlias" name="projectAlias" style="width: 150px;" value="">
                                    <font color="red">*（项目别名必须填写）</font>
                                </td>
                            </tr>

                            

                        </tbody>
                    </table>
                </form>
            </div>

        </div>
    </div>


    <div class="bottom_fixbox">
        <div class="rectbox tac">
            <input type="button" class="btn" onclick="projectAdd.check()" value="添加项目" />&nbsp;&nbsp;&nbsp;
            <input type="button" class="btn" onclick="E.closeWindows();" value="关闭" />
        </div>
    </div>

    <!--{include file='comm/footer.tpl'}-->

</div>

<script type="text/javascript">


    var projectAdd = {

        //检查数据
        check: function() {

            this.dt = E.getFormValues("project_test");

            var error_msg = "";

            if( this.dt.projectName == '' )
                error_msg += "项目名称不能为空<br />";

            if (this.dt.projectAlias == "")
                error_msg += "项目别名不能为空<br />";
                this.add();
        },

        //保存或更新代金卡信息
        add: function() {
            $.ajax({
                type: "POST",
                url: "/invokingAjax-backend/project/projectList.ajax?operFlg=2",
                dataType: "JSON",
                data: this.dt,
                success: function( result_obj ) {				
					
                    if (result_obj.code == 200) {
						
						 E.alert(result_obj.message, 2, "E.closeWindows");
						 E.openr('projectList.load');
                    } else {
                        E.alert(result_obj.message);
                    }
                }
            });
        }

    };


</script>


</body>

</html>